<?php /* Smarty version 2.6.26, created on 2018-07-25 15:09:27
         compiled from E:%5CWWW%5C40.125.208.171%5Cvweb/admin%5Ctemplates/category/index.html */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'date_format', 'E:\\WWW\\40.125.208.171\\vweb/admin\\templates/category/index.html', 38, false),)), $this); ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "index/header.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?> 
<div class="nav"><span>分类列表</span></div> 
<div class="filter">
	<a href="?m=category&a=edit" class="add">添加分类</a>
	<?php if ($_GET['cid']): ?>
		<a href="javascript:;" onclick="javascript:history.back(-1);" class="button">返回上一级</a>
	<?php endif; ?>
</div>
<div class="main"> 
	<table class="ltable">
		<thead>
			<tr> 
				<th width="280">分类名</th> 
				<th width="80">排序</th>
				<th width="60" class="center">首页</th>
				<th width="60" class="center">热门</th>
				<th width="60" class="center">推荐</th>
				<th width="60">状态</th>
				<th width="138">操作</th>
				<th width="150">创建时间</th>
				<th></th>
			</tr>
		</thead>
		<tbody>
	<?php if ($this->_tpl_vars['data']): ?> 
		<?php $_from = $this->_tpl_vars['data']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['i']):
?>
			<tr> 
				<td><a href="?m=category&a=index&cid=<?php echo $this->_tpl_vars['i']['cid']; ?>
&from_cid=<?php echo $this->_tpl_vars['i']['pcid']; ?>
" class="down"><?php echo $this->_tpl_vars['i']['name']; ?>
</a></td> 
				<td><div id="px_<?php echo $this->_tpl_vars['i']['cid']; ?>
" class="pxdo" pxid="<?php echo $this->_tpl_vars['i']['cid']; ?>
"><?php echo $this->_tpl_vars['i']['px_asc']; ?>
</div></td>
				<td class="center"><a href="javascript:status('<?php echo $this->_tpl_vars['i']['cid']; ?>
','px_index')" id="px_index_<?php echo $this->_tpl_vars['i']['cid']; ?>
"><img src="<?php echo $this->_tpl_vars['__APP__']; ?>
public/images/status_<?php echo $this->_tpl_vars['i']['px_index']; ?>
.png"></a></td>
				<td class="center"><a href="javascript:status('<?php echo $this->_tpl_vars['i']['cid']; ?>
','px_hot')" id="px_hot_<?php echo $this->_tpl_vars['i']['cid']; ?>
"><img src="<?php echo $this->_tpl_vars['__APP__']; ?>
public/images/status_<?php echo $this->_tpl_vars['i']['px_hot']; ?>
.png"></a></td>
				<td class="center"><a href="javascript:status('<?php echo $this->_tpl_vars['i']['cid']; ?>
','px_recommend')" id="px_recommend_<?php echo $this->_tpl_vars['i']['cid']; ?>
"><img src="<?php echo $this->_tpl_vars['__APP__']; ?>
public/images/status_<?php echo $this->_tpl_vars['i']['px_recommend']; ?>
.png"></a></td>
				<td><?php if ($this->_tpl_vars['i']['status'] == '1'): ?>正常<?php else: ?>关闭<?php endif; ?></td> 
				<td>
					<a href="?m=category&a=edit&cid=<?php echo $this->_tpl_vars['i']['cid']; ?>
" class="edit">编辑</a> 
					<a href="?m=category&a=del&cid=<?php echo $this->_tpl_vars['i']['cid']; ?>
" class="del">删除</a>
				</td>
				<td><?php echo ((is_array($_tmp=$this->_tpl_vars['i']['addtime'])) ? $this->_run_mod_handler('date_format', true, $_tmp, '%Y-%m-%d %H:%M') : smarty_modifier_date_format($_tmp, '%Y-%m-%d %H:%M')); ?>
'</td>
				<td></td>
			</tr> 
		<?php endforeach; endif; unset($_from); ?>
	<?php else: ?>
	  <tr><td colspan="9">还没有数据，赶快添加吧！</td></tr>
	<?php endif; ?>
	</tbody>
</table> 
</div>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "index/footer.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?> 
<script type="text/javascript">
ajaxEdit(".pxdo","pxid",'?m=category&a=px_update', 'cid', 'px');
function del() {
	if (!confirm("确认要删除？")) {
		window.event.returnValue = false;
	}
}
function status(cid,type){
	$.post("?m=category&a=px_status",{cid:cid, type:type},function(data){
 		if(data == '0' || data == '1'){
			$("#"+type+"_"+cid+" img").attr('src','<?php echo $this->_tpl_vars['__APP__']; ?>
public/images/status_'+data+'.png');
		}else{ 
			alert('更新失败'); 
		} 
	});	
}  
</script> 